package com.sinosoft.etp.up.testpaper.dto;

import com.alibaba.fastjson.JSONObject;
import com.sinosoft.common.annotation.Excel;
import com.sinosoft.common.core.domain.BaseEntity;
import com.sinosoft.etp.common.constant.SubjectType;

import java.util.List;

/**
 * TSubject 的扩展类，包括学生的答案、机判得分、评卷得分、评卷评语
 *
 */
public class TSubjectAnsweredReview extends BaseEntity {
    private String da;

    private String jx;

    /**
     * 机判得分
     */
    private Double logicalScore;
    /**
     * 纠正得分
     */
    private Double correctedScore;
    /**
     * 评语、评论
     */
    private String review;
    /**
     * 是否正确
     */
    private boolean isRight = false;

    public boolean getIsRight() {
        return isRight;
    }

    public void setIsRight(boolean isRight) {
        this.isRight = isRight;
    }

    Double score;

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }

    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 题干 */
    @Excel(name = "题干")
    private String tg;

    /** 类型：
     单选题：1
     复选题：2
     判断题：3
     填空题：4
     问答题：5 */
    @Excel(name = "类型")
    private String lx;
    /** 类型名称*/
    private String lxbq;

    /** 选项 ：仅单选、复选时有值。可以存json */
    @Excel(name = "选项")
    private String xx;

    // 填空题有几个空
    private Integer place;

    public void setPlace(Integer place) {
    }

    public boolean isRight() {
        return isRight;
    }

    public void setRight(boolean right) {
        isRight = right;
    }

    public Integer getPlace() {
        // 只有填空题才会计算空的个数
        if (SubjectType.FILL_IN_THE_BLANKS.equals(lx))
            return JSONObject.parseObject(getDa(), List.class).size();
        else return 0;
    }

    private Integer tkid;
    private Integer sjid;
    private Integer sort;

    /** 是否练习
     是：1
     否：0 */
    @Excel(name = "是否练习")
    private String sflx;

    /** 是否考试 是：1
     否：0 */
    @Excel(name = "是否考试")
    private String sfks;

    /** 删除 */
    private String delFlag;
    private String tags;

    /**
     * 学生答案
     */
    private String answered;


    public String getAnswered() {
        return answered;
    }

    public void setAnswered(String answered) {
        this.answered = answered;
    }

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setTg(String tg)
    {
        this.tg = tg;
    }

    public String getTg()
    {
        return tg;
    }
    public void setLx(String lx)
    {
        this.lx = lx;
    }

    public String getLx()
    {
        return lx;
    }
    public void setXx(String xx)
    {
        this.xx = xx;
    }

    public String getXx()
    {
        return xx;
    }

    public void setSflx(String sflx)
    {
        this.sflx = sflx;
    }

    public Integer getTkid() {
        return tkid;
    }

    public void setTkid(Integer tkid) {
        this.tkid = tkid;
    }

    public Integer getSjid() {
        return sjid;
    }

    public void setSjid(Integer sjid) {
        this.sjid = sjid;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getSflx()
    {
        return sflx;
    }
    public void setSfks(String sfks)
    {
        this.sfks = sfks;
    }

    public String getSfks()
    {
        return sfks;
    }
    public void setDelFlag(String delFlag)
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag()
    {
        return delFlag;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public String getLxbq() {
        return lxbq;
    }

    public void setLxbq(String lxbq) {
        this.lxbq = lxbq;
    }


    public Double getLogicalScore() {
        return logicalScore;
    }

    public void setLogicalScore(Double logicalScore) {
        this.logicalScore = logicalScore;
    }

    public Double getCorrectedScore() {
        return correctedScore;
    }

    public void setCorrectedScore(Double correctedScore) {
        this.correctedScore = correctedScore;
    }

    public String getReview() {
        return review;
    }

    public void setReview(String review) {
        this.review = review;
    }

    public String getDa() {
        return da;
    }

    public void setDa(String da) {
        this.da = da;
    }

    public String getJx() {
        return jx;
    }

    public void setJx(String jx) {
        this.jx = jx;
    }
}
